package com.aqie.rabbit.bean.api.group;

import com.google.gson.annotations.Expose;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.HashSet;
import java.util.Set;

public class GroupCreateModel {
    @Expose
    @NotBlank
    private String name;
    @Expose
    @NotBlank
    private String desc;
    @Expose
    @NotBlank
    private String picture;
    // 存储用户id
    @Expose
    @NotNull
    private Set<String> users = new HashSet<>();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public Set<String> getUsers() {
        return users;
    }

    public void setUsers(Set<String> users) {
        this.users = users;
    }

    public static boolean check(GroupCreateModel model) {
        return !( model.users == null
                || model.users.size() == 0);
    }
}
